'use strict';

const conn = require('../../../libs/Conn');
const util = require('../../../libs/Utils');

module.exports = async function (params) {
    let encryptPassword = util.encrypt(params.mobile.substr(params.mobile.length - 6, 6));
    let insertObj ={
        user_id :util.uuid(),
        password:encryptPassword,
        mobile:params.mobile,
        group_id:params.group_id,
        login_name:params.mobile,
        user_name:params.user_name,
        enable:params.enable_char,
        delete_sign:1
    };

    let updateSql = `INSERT INTO user_file SET ?`;
    await conn(updateSql,[insertObj]);
    return {success: true};

};